@*
* Copyright 2016 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*@

<p>
    This analysis shows whether there is a data-skew for reduce tasks of the Tez applicaiton.
</p>
<p>
    This result of the analysis shows two groups of the spectrum, where the first group has significantly less input data compared to the second group.
</p>
<h5>Example</h5>
<p>
<div class="list-group">
    <a class="list-group-item list-group-item-danger" href="">
        <h4 class="list-group-item-heading">Reducer Data Skew</h4>
        <table class="list-group-item-text table table-condensed left-table">
            <thead><tr><th colspan="2">Severity: Critical</th></tr></thead>
            <tbody>
            <tr>
                <td>Number of tasks</td>
                <td>999</td>
            </tr>
            <tr>
                <td>Group A</td>
                <td>875 tasks @@ 28 MB avg</td>
            </tr>
            <tr>
                <td>Group B</td>
                <td>124 tasks @@ 2 GB avg</td>
            </tr>
            </tbody>
        </table>
    </a>
</div>
</p>
<h3>Suggestions</h3>
<p>
    Check if the number of reducers are being determined appropriately. We can enable optimization of skew join i.e. imbalanced joins by setting hive.optimize.skewjoin property to true..<br>
    set hive.optimize.skewjoin to true. By setting hive.skewjoin.key to a specified number like 10000, the job 
    can determine if the join is skewed or not.<br>
</p>